home *** CD-ROM | disk | FTP | other *** search
- Path: news.mindspring.com!usenet
- From: rudd@mindspring.com (Justin Rudd)
- Newsgroups: comp.lang.c++
- Subject: Re: CFile read problem.....
- Date: Mon, 18 Mar 1996 04:17:16 GMT
- Organization: MindSpring Enterprises
- Message-ID: <4iio6j$itl@B1FF.mindspring.com>
- References: <4ii1ck$bve@newsbf02.news.aol.com>
- Reply-To: rudd@mindspring.com
- NNTP-Posting-Host: rudd.mindspring.com
- X-Newsreader: Forte Free Agent v0.55
-
- >note: buffer2 is a string that contains the path where the config.dat
- >file is located.
- >We do not know the proper syntax required to use the buffer2 and
- >config.dat file
- >together. The code listed above does not work for this reason. We've tried
- >many things
- >without any luck. If we use this code: CFile
- >readMe("C:\\Prog\\config.dat",
- >CFile::modeRead ); it works fine....However, we need to use it with the
- >buffer2 string
- >which contains the path to the directory. We know that buffer2 string
- >holds the path since
- >we used "trace" to verify it.
-
- >Does anyone know how to accomplish this?
-
- Couldn't you do this:
-
- char temp[MAX_PATH];
- strccpy( temp, buffer2 );
- strcat( temp, "\\config.dat" );
- CFile readMe( temp, CFile::modeRead );
-
- Then just pass temp to the CFile ctor. I've used this "trick" ( if
- you can call it that ) many times.
-
- Justin
-
-